package com.ytjj.qmyx.admin.service.impl;

import com.github.pagehelper.PageHelper;
import com.ytjj.common.api.CommonPage;
import com.ytjj.qmyx.admin.dao.EvaluationProductSpecDao;
import com.ytjj.qmyx.admin.model.request.EvaluationRequest;
import com.ytjj.qmyx.admin.service.EvaluationProductSpecService;
import com.ytjj.qmyx.mall.model.EvaluationProductSpec;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 
 *
 * @Version: 1.0
 */
@Service
public class EvaluationProductSpecServiceImpl implements EvaluationProductSpecService {

    @Autowired
    private EvaluationProductSpecDao evaluationProductSpecDao;

    @Override
    public CommonPage<EvaluationProductSpec> getSpecList(EvaluationRequest evaluationRequest) {
        PageHelper.startPage(evaluationRequest.getPageNum(), evaluationRequest.getPageSize());
        List<EvaluationProductSpec> pageList = evaluationProductSpecDao.getSpecList(evaluationRequest.getProductId());
        return CommonPage.restPage(pageList);
    }

    @Override
    public Integer updateSpecInfo(EvaluationProductSpec evaluationProductSpec) {
        return evaluationProductSpecDao.updateSpecInfo(evaluationProductSpec);
    }
}
